home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tpl60n11.zip / README.DOC < prev    next >
Text File  |  1992-04-01  |  13KB  |  259 lines

  1.      Turbo-Pascal 6.0 Runtime Libary Update - Release 1.1 Beta 04-01-1992
  2.  
  3.      This library is a complete replacement for the runtime library that
  4.      came with your Turbo Pascal 6.0 compiler. Due to lots of optimizations,
  5.      programs compiled with this version of TURBO.TPL will be faster.
  6.      This library maintains 99.9% compatibility with the original library.
  7.      Differences are usually due to enhancements and should not cause
  8.      any compatibility problems. Some bugs from the original library
  9.      supplied by Borland have been eliminated, but there can be no guarantee
  10.      that new ones have not crept in. If you discover any bugs, or have
  11.      other comments, please let me know. My email and snail mail addresses
  12.      are given below. Due to the nature of Borland's licensing of the
  13.      TPL source code I am not allowed to distribute the source code of
  14.      my enhanced library, so I can only provide the binary.
  15.  
  16.      Original library code is Copyright (C) 1983,91 Borland International
  17.  
  18.      New / additional library code is Copyright (C) 1988-1992
  19.      Norbert Juffa, Wielandtstr. 14, 7500 Karlsruhe 1, Germany
  20.      Internet: S_JUFFA@IRAVCL.IRA.UKA.DE
  21.  
  22.  
  23.      Improvements in SYSTEM module
  24.      -----------------------------
  25.  
  26. o    REAL type software arithmetic operations now comply with ANSI/IEEE
  27.      Standard 754-1985 for Binary Floating Point Arithmetic [1,2] as much
  28.      as possible. Note that REAL arithmetic by design differs from the
  29.      standard in many ways, especially available numeric formats, value
  30.      set, and available operations. The rounding mode implemented here
  31.      is "round to nearest or even" as specified in the standard. Add,
  32.      Subtract, Multiply, Division, and Square Root deliver exact results
  33.      with regard to this rounding mode, as demanded by the standard.
  34.      Conversions from REAL to LONGINT and from EXTENDED to REAL use
  35.      rounding to nearest or even, as specified in the standard. Correct
  36.      implementation of above features was tested with the PARANOIA test
  37.      program [3].
  38.  
  39. o    REAL arithmetic operations have been sped up. Speed up is fourfold for
  40.      SQRT (up to 22x on a 80386), twofold for FRAC and between 30% and 40%
  41.      for ARCTAN, LN, EXP and division (2.5x speed up for division on 80386).
  42.      Speed increase for SIN/COS functions is smaller (about 10%) since speed
  43.      was sacrificed in favor of more accurate results here. Overall numeric
  44.      processing power using REAL arithmetic increases by about 26% for an
  45.      8086 and by 38% for an 80386 as measured by the WHETSTONE benchmark [4,5].
  46.  
  47. o    Overall accuracy of REAL arithmetic transcendental functions has been
  48.      improved as indicated by Cody&Waite's ELEFUNT tests [6]: DLOG, DEXP,
  49.      DATAN, DSIN. Correct argument reduction ensures that relative error
  50.      over the whole argument range does not exceed 2.1e-12 for Exp, 3.1e-12
  51.      for Arctan, and 2.7e-12 for Ln. For Sin and Cos, relative error is
  52.      also in this range when the argument is reasonably small (e.g. in range
  53.      -100..100) and not very close to an integer multiple of 0.5*Pi. Note
  54.      that due to accurracy requirements, the range of Sin/Cos arguments has
  55.      been reduced to -9.22337e18..9.22337e18. An error 207 (invalid float
  56.      operation) will be signaled for arguments outside this range.
  57.  
  58. o    Faster execution of coprocessor floating point computations using an
  59.      80287 or 80387. For these coprocessors, NOPs will be inserted before
  60.      every floating point instruction converted from an emulator interrupt
  61.      instead of WAITs. As a result of this optimization, an improvement in
  62.      execution speed of 14% has been observed running the Lawrence Livermore
  63.      Loops (LLL) [7] on a Cyrix 83D87, the improvement for the WHETSTONE
  64.      benchmark on the 83D87 is 9.4%.
  65.  
  66. o    On a 80287XL, 80387, or 80846 the Sin and Cos functions take advantage
  67.      of the FSIN and FCOS instructions of these coprocessors, speeding up
  68.      these functions by almost a factor of two. Also, the Arctan function
  69.      takes advantage of the increased argument range of the FPATAN function.
  70.      These optimizations result in another 19% increase in WHETSTONE power,
  71.      so that the total combined speedup over the original library is 30%
  72.      for this benchmark.
  73.  
  74. o    STRING operations are faster, especially for longer strings. Most
  75.      dramatic increase is in the INSERT function, with execution times
  76.      reduced to up to one fourth compared with the original version of RTL.
  77.      Faster string operations cause 7% performance increase for the
  78.      DHRYSTONE [8,9] benchmark on a 8086.
  79.  
  80. o    Improved speed of random number generation. Random for REAL numbers
  81.      is 10% faster, Random for EXTENDED numbers is 5% faster, no speed
  82.      difference for Integer Random function.
  83.  
  84. o    Binary to decimal conversions used in Str and Write procedures have
  85.      been sped up by up to 70% for integers (BYTE, SHORTINT, INTEGER,
  86.      WORD, LONGINT), up to 5% for REAL numbers and about 3% for EXTENDED
  87.      numbers.
  88.  
  89. o    Improved speed of LONGINT arithmetic. Division enjoys fourfold
  90.      reduction of execution time on 8086, for an 80386 the speed up
  91.      factor is 6.7.
  92.  
  93. o    Several of the functions of the heap manager have been tuned,
  94.      giving up to 10% faster operation for these routines.
  95.  
  96. o    Set functions have been sped up by a few percent, but the add
  97.      variable range operation may be up to eight times as fast.
  98.  
  99. o    UPCASE function has been enhanced to support complete the IBM character
  100.      set. This means that characters ä,ü,ö,å,æ,é,ñ,ç are converted to upper
  101.      case by this function.
  102.  
  103. o    Several bugs have been fixed:
  104.  
  105.      The Random function could return 1.0 when compiled in the $N+ state,
  106.      although the specifications call for a return value 0 <= Random < 1.
  107.      This has been corrected. Return values from Random will be strictly
  108.      smaller than 1 now.
  109.  
  110.      GetDir now correctly returns a run-time error 15 (invalid drive)
  111.      when called with a non existent drive.
  112.  
  113.      LONGINT Read and Val routines now accept the smallest LONGINT
  114.      number -2147483648 as decimal input.
  115.  
  116.      For programs compiled with $N+, only true INFs are printed out as
  117.      INF where with the original library some NaNs are also printed as
  118.      INF. Correct operation can be tested with the INFBUG program.
  119.  
  120.      Multiplication of REAL numbers by small integers was inaccurate,
  121.      causing among others problems unnecessary inaccuracies in binary
  122.      <-> decimal conversion. This has been eliminated with the new
  123.      REAL arithmetic modules.
  124.  
  125.      REAL arithmetic EXP functions no longer signals overflow when
  126.      called with small arguments, but underflows to zero instead as it
  127.      should.
  128.  
  129.      Denormals in EXTENDED computations no longer cause invalid state
  130.      on 8087 coprocessor when being converted to true zeros. Consistency
  131.      between register contents and tag bits is now asserted. Removal of
  132.      this bug can be tested with the BUG87 program.
  133.  
  134.      Stack checking routine for programs compiled in the $S+ state now
  135.      reliably detects all stack overflows.
  136.  
  137.      Program initialization routine now tries to prevent that programs
  138.      compiled with the $G+ (286 code generation) switch are run on 8086
  139.      and 8088. The checks done are not 100% safe, but catch most of these
  140.      cases, displaying the message "CPU > 8086 required" and aborting the
  141.      program instead of letting it crash. Note that this check lets programs
  142.      compiled with $G+ run on 80186 and V20/V30 processors, since these
  143.      have the ability to process all 80286 real mode instructions produced
  144.      by Turbo Pascal.
  145.  
  146. o    Improved functionality only marginally increases overall code length
  147.      of the SYSTEM unit by 385 bytes (less than 2%). This is due to careful
  148.      optimizing in numerous routines. Most programs compiled with the new
  149.      RTL will be smaller due to finer granularity of the RTL modules.
  150.      Savings are usually in the 1 KB range for reasonably large programs.
  151.  
  152.  
  153.      Improvements in DOS module
  154.      --------------------------
  155.  
  156. o    Decreased code size by careful optimization of register usage in
  157.      some routines.
  158.  
  159.  
  160.      Improvements in CRT module
  161.      --------------------------
  162.  
  163. o    Bug fix in routine DirectWrite. The method used to prevent "snow"
  164.      when writing directly to a CGA graphics card was not entirely save.
  165.      When used in a heavily interrupted program (e.g. serial communication
  166.      as a background task), it would not always write during the time
  167.      when scanning was in the invisible parts of the screen. The method
  168.      used now is 100% save and is even faster, since it takes advantage
  169.      of the horizontal and vertical retrace periods, as opposed to the
  170.      old method which only used the horizontal retrace time. New routine
  171.      has been tested successfully on original IBM-CGA card.
  172.  
  173.  
  174.      Changes since first beta release (version 1.0, dated 03-21-92)
  175.      --------------------------------------------------------------
  176.  
  177. o    Fixed bug in the routine that adds variable ranges to sets (as in
  178.      s := [foo..bar], where s is a set and foo and bar are variables of
  179.      the set's base type.
  180.  
  181. o    Switched back code in the REAL add/subtract routine to plain 8086
  182.      code. Forgot to remove the use386 flag when building code for the
  183.      original release 1.0 beta.
  184.  
  185.  
  186.      Changes since the alpha release
  187.      -------------------------------
  188.  
  189. o    There was an error in the 8087 float to string conversion in the
  190.      alpha release which has been fixed.
  191.  
  192. o    A bug in the coprocessor identification that sets the Test8087 variable
  193.      present in the alpha release has been fixed.
  194.  
  195. o    For string -> LONGINT conversion, it is now possible to input the
  196.      smallest LONGINT number -2147483648 in decimal.
  197.  
  198. o    An enhanced argument reduction has been implemented for REAL arithmetic
  199.      SIN, COS, and EXP function, delivering much more accurate results over
  200.      the complete argument range. This has slowed these functions down
  201.      somewhat, however, none of them runs slower than in the original TP 6.01
  202.      RTL. As a result of the new argument reduction, arguments to SIN and
  203.      COS are restricted to the range -3.37325e9..3.37325e9 now. Arguments to
  204.      these functions were previously unrestricted. For arguments outside the
  205.      range given, an error 207 will result. This is consistent with the
  206.      coprocessor/emulator generated SIN/COS functions, that also signal
  207.      error 207 for arguments out of range (-9.22337e18..9.22337e18).
  208.  
  209. o    SIN, COS, and ARCTAN functions compiled in the $N+ state will now use
  210.      the faster coprocessor instructions available on the 387 and 486 if
  211.      such a coprocessor/FPU is present.
  212.  
  213. o    A check has been included to prevent programs compiled with $G+ (286 code
  214.      generation) to run on a 8086.
  215.  
  216. o    The Random function has been fixed to return value strictly smaller than
  217.      1 when compiled with $N+.
  218.  
  219.  
  220.      References
  221.      ----------
  222.  
  223. [1]  IEEE: IEEE Standard for Binary Floating-Point Arithmetic.
  224.      SIGPLAN Notices, Vol. 22, No. 2, 1985, pp. 9-25
  225.  
  226. [2]  IEEE Standard for Binary Floating-Point Arithmetic.
  227.      ANSI/IEEE Std 754-1985.
  228.      New York, NY: Institute of Electrical and Electronics Engineers 1985
  229.  
  230. [3]  Karpinski, R.: Paranoia: A Floating-Point Benchmark.
  231.      Byte, February 1985, pp. 223-235
  232.  
  233. [4]  Curnow, H.J.; Wichmann, B.A.: A synthetic benchmark.
  234.      Computer Journal, Vol. 19, No. 1, 1976, pp. 43-49
  235.  
  236. [5]  Wichmannn, B.A.: Validation code for the Whetstone benchmark.
  237.      NPL Report DITC 107/88, National Physics Laboratory, UK, March 1988
  238.  
  239. [6]  Cody, W.J.; Waite, W.: Software Manual for the Elementary Functions.
  240.      Englewood Cliffs, NJ: Prentice Hall 1980
  241.  
  242. [7]  McMahon, H.H.: The Livermore Fortran Kernels: A Test of the Numerical
  243.      Performance Range.
  244.      Technical Report UCRL-53745, Lawrence Livermore National Laboratory,
  245.      December 1986, p. 179
  246.  
  247. [8]  Weicker, R.P.: Dhrystone: A Synthetic Systems Programming Benchmark.
  248.      Communications of the ACM, Vol. 27, No. 10, October 1984, pp. 1013-1030
  249.  
  250. [9]  Weicker, R.P.: Dhrystone Benchmark: Rationale for Version 2 and
  251.      Measurement Rules.
  252.      SIGPLAN Notices, Vol. 23, No. 8, August 1988, pp. 49-62
  253.  
  254.      Note:
  255.  
  256.      PARANOIA, DHRYSTONE, WHETSTONE, LLL, and ELEFUNT source code is
  257.      available from NETLIB@ORNL.GOV
  258.  
  259.